package cn.com.dhcc.turbo.entity.registry;

import java.util.Date;

import cn.com.dhcc.app.core.annotation.SiColumn;
import cn.com.dhcc.app.core.annotation.SiNotDbColumn;
import cn.com.dhcc.app.core.annotation.SiTable;
import cn.com.dhcc.app.core.base.ModuleFeatureBean;

/**
 * 队列信息
 */
@SiTable(name = "turbo_queue")
public class Queue extends ModuleFeatureBean {
	@SiColumn(isId = true)
	private String id; //队列id
	@SiColumn(name = "node_id")
	private String nodeId; //节点ID
	@SiNotDbColumn
	private String remoteName;//远程队列名称
	@SiColumn(name = "queue_name")
	private String queueName; //队列名称
	@SiColumn(name = "queue_desc")
	private String queueDesc; //队列名称描述
	@SiColumn(name = "broker_type")
	private String brokerType;//消息中间件类型：TLQ|AMQ
	@SiColumn(name = "queue_type")
	private String queueType; //队列类型 0:接收队列   1：发送队列
	@SiColumn(name = "dest_queue_name")
	private String destQueueName;//目的队列的名称(当type为1是才有意义)
	@SiColumn(name = "dest_ip")
	private String destIp; //目的队列的IP(当type为1是才有意义)
	private String remark; //备注
	private Date mtime; //最后修改时间

	@SiNotDbColumn
	private String isQueueExist;//判断队列是否真的在消息中间件中成功创建了 1:是 0:否

	
	
	public String getRemoteName() {
		return remoteName;
	}

	public void setRemoteName(String remoteName) {
		this.remoteName = remoteName;
	}

	public String getId() {
		return id;
	}

	public String getNodeId() {
		return nodeId;
	}

	public String getQueueName() {
		return queueName;
	}

	public String getQueueDesc() {
		return queueDesc;
	}

	public String getBrokerType() {
		return brokerType;
	}

	public String getQueueType() {
		return queueType;
	}

	public String getDestQueueName() {
		return destQueueName;
	}

	public String getDestIp() {
		return destIp;
	}

	public String getRemark() {
		return remark;
	}

	public Date getMtime() {
		return mtime;
	}

	public String getIsQueueExist() {
		return isQueueExist;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	public void setQueueName(String queueName) {
		this.queueName = queueName;
	}

	public void setQueueDesc(String queueDesc) {
		this.queueDesc = queueDesc;
	}

	public void setBrokerType(String brokerType) {
		this.brokerType = brokerType;
	}

	public void setQueueType(String queueType) {
		this.queueType = queueType;
	}

	public void setDestQueueName(String destQueueName) {
		this.destQueueName = destQueueName;
	}

	public void setDestIp(String destIp) {
		this.destIp = destIp;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public void setMtime(Date mtime) {
		this.mtime = mtime;
	}

	public void setIsQueueExist(String isQueueExist) {
		this.isQueueExist = isQueueExist;
	}

	@Override
	public String toString() {
		return "Queue [id=" + id + ", nodeId=" + nodeId + ", queueName=" + queueName + ", queueDesc=" + queueDesc
				+ ", brokerType=" + brokerType + ", queueType=" + queueType + ", destQueueName=" + destQueueName
				+ ", destIp=" + destIp + ", remark=" + remark + ", mtime=" + mtime + ", isQueueExist=" + isQueueExist
				+ "]";
	}

	/**
	 * Broker类型
	 */
	public static enum BrokerType {
		TLQ("TLQ", "TonglinkQ"), AMQ("AMQ", "apache Active MQ");
		private String type;
		private String desc;

		private BrokerType(String type, String desc) {
			this.type = type;
			this.desc = desc;
		}

		public String getType() {
			return type;
		}

		public String getDesc() {
			return desc;
		}

		public void setType(String type) {
			this.type = type;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		public String value() {
			return this.type;
		}

		@Override
		public String toString() {
			return type;
		}
	}

	/**
	 * 队列类型
	 */
	public static enum QueueType {
		LQ("0", "接收队列"), SQ("1", "发送队列");
		private String type;
		private String desc;

		private QueueType(String type, String desc) {
			this.type = type;
			this.desc = desc;
		}

		public String getType() {
			return type;
		}

		public String getDesc() {
			return desc;
		}

		public void setType(String type) {
			this.type = type;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		public String value() {
			return this.type;
		}

		@Override
		public String toString() {
			return type;
		}
	}
}
